package org.itheima.config;


import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import redis.clients.jedis.Jedis;

@Configuration
@EnableConfigurationProperties(RedisProperties.class)
public class RedisAutoConfiguration {

    @Bean
    public Jedis jedis(RedisProperties redisProperties){
        System.out.println("配置类的jedis被初始化了");
        Jedis jedis = new Jedis(redisProperties.getHost(), redisProperties.getPort());
        jedis.auth("123456");
        return jedis;


    }
}
